package edu.sctu.zcy.month201505.day20150512;

public class Order {

    //完成 main 方法
    public static void main(String[] args) {
        int[] a={89,-23,64,91,119,52,73};
        prints(a);



    }

    //定义方法完成成绩排序并输出前三名的功能
    public static void prints(int[] print){
       int k;
        p: for(int i=0;i<print.length;i++){
            if(print[i]<0 || print[i]>100){
                System.out.println("成绩无效");
                continue p;
            }else {

                for (int j = 0; j < print.length - 1; j++) {
                    if (print[j] < print[j + 1]) {
                        k = print[j];
                        print[j] = print[j + 1];
                        print[j + 1] = k;
                    }
                }
            }
        }
        for(int i=1;i<4;i++){
            System.out.println("前三名成绩为"+print[i]);
        }

    }
}
